Conversation
Test these macros with the limited C API in _testlimitedcapi and test_cext. Move also other tests (refcount, Py_CLEAR, etc.) to _testlimitedcapi.
|
Note: |
Documentation build overview
4 files changed± c-api/refcounting.html± c-api/stable.html± whatsnew/3.16.html± whatsnew/changelog.html |
|
Could you add them to |
picnixz
left a comment
There was a problem hiding this comment.
If this only moving code, then this LGTM.
Oh right... I totally forgot about that. It's for the docs rendering right? |
Sure, done. I forgot that we also put macros in stable_abi.toml. I also added Py_CLEAR(). It seems like Py_CLEAR() was added to Python 2.4 (so it's available since limited C API 3.2). |
I learned recently that abi3audit uses the toml table as input for a codegen script that generates the abi3audit implementation. I'd also like to use it in PyO3 for static checks. So downstream appreciates it being accurate and updated. |
|
@encukou: Oh, Doc/c-api/refcounting.rst has It makes Sphinx grumpy because it's once documented as a function, and then documented as a macro... Should I change the documentation to document Py_CLEAR() as a macro? Sphinx error:
|
|
Maybe leave the existing ones to a different PR. As docs fixes, they're backportable.
…On October 5, 2026 7:30:50 PM GMT+02:00, Victor Stinner ***@***.***> wrote:
vstinner left a comment (python/cpython#158843)
@encukou: Oh, Doc/c-api/refcounting.rst has `.. c:function:: void Py_CLEAR(PyObject *o)` whereas Misc/stable_abi.toml has `[macro.Py_CLEAR]`.
It makes Sphinx grumpy because it's once documented as a function, and then documented as a macro... Should I change the documentation to document Py_CLEAR() as a macro?
Sphinx error:
`sphinx.errors.SphinxParallelError: sphinx.errors.ExtensionError: Handler <function add_annotations at 0x7172f4a81fd0> for event 'doctree-read' threw an exception (exception: Object type mismatch in limited API annotation for Py_CLEAR: 'macro' != 'function')`
--
Reply to this email directly or view it on GitHub:
#158843 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
This reverts commit 2373d5a.
I'm not sure why this job took 15 minutes. It seems like something went wrong. I clicked on re-run failed jobs. |
Test these macros with the limited C API in _testlimitedcapi and test_cext.
Move also other tests (refcount, Py_CLEAR, etc.) to _testlimitedcapi.